﻿namespace OboutInc.Splitter2
{
    using OboutInc.Splitter2.Design;
    using System;
    using System.Collections.Specialized;
    using System.ComponentModel;
    using System.Drawing;
    using System.IO;
    using System.Text;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;

    [ParseChildren(true), PersistChildren(false), ToolboxBitmap(typeof(Splitter), "splitter.png"), Designer(typeof(VerticalDesigner)), ToolboxData("<{0}:Splitter runat=server>\n<LeftPanel>\n<Content>\n...left panel content here...\n</Content>\n</LeftPanel>\n<RightPanel>\n<Content>\n...right panel content here...\n</Content>\n</RightPanel></{0}:Splitter>")]
    public class Splitter : Control, INamingContainer, IPostBackDataHandler
    {
        private int _1ContentScrollX;
        private int _1ContentScrollY;
        private int _1FooterScrollX;
        private int _1FooterScrollY;
        private int _1HeaderScrollX;
        private int _1HeaderScrollY;
        private int _2ContentScrollX;
        private int _2ContentScrollY;
        private int _2FooterScrollX;
        private int _2FooterScrollY;
        private int _2HeaderScrollX;
        private int _2HeaderScrollY;
        private string _ClientID = string.Empty;
        private bool ScriptResourceRendered;

        public bool LoadPostData(string postDataKey, NameValueCollection postCollection)
        {
            if (this.RememberScrollPosition)
            {
                string s = postCollection["h_" + this.ClientID + "_1HeaderX"];
                string str2 = postCollection["h_" + this.ClientID + "_1HeaderY"];
                string str3 = postCollection["h_" + this.ClientID + "_1ContentX"];
                string str4 = postCollection["h_" + this.ClientID + "_1ContentY"];
                string str5 = postCollection["h_" + this.ClientID + "_1FooterX"];
                string str6 = postCollection["h_" + this.ClientID + "_1FooterY"];
                if (!s.Equals(string.Empty))
                {
                    this._1HeaderScrollX = int.Parse(s);
                }
                if (!str2.Equals(string.Empty))
                {
                    this._1HeaderScrollY = int.Parse(str2);
                }
                if (!str3.Equals(string.Empty))
                {
                    this._1ContentScrollX = int.Parse(str3);
                }
                if (!str4.Equals(string.Empty))
                {
                    this._1ContentScrollY = int.Parse(str4);
                }
                if (!str5.Equals(string.Empty))
                {
                    this._1FooterScrollX = int.Parse(str5);
                }
                if (!str6.Equals(string.Empty))
                {
                    this._1FooterScrollY = int.Parse(str6);
                }
                string str7 = postCollection["h_" + this.ClientID + "_2HeaderX"];
                string str8 = postCollection["h_" + this.ClientID + "_2HeaderY"];
                string str9 = postCollection["h_" + this.ClientID + "_2ContentX"];
                string str10 = postCollection["h_" + this.ClientID + "_2ContentY"];
                string str11 = postCollection["h_" + this.ClientID + "_2FooterX"];
                string str12 = postCollection["h_" + this.ClientID + "_2FooterY"];
                if (!str7.Equals(string.Empty))
                {
                    this._2HeaderScrollX = int.Parse(str7);
                }
                if (!str8.Equals(string.Empty))
                {
                    this._2HeaderScrollY = int.Parse(str8);
                }
                if (!str9.Equals(string.Empty))
                {
                    this._2ContentScrollX = int.Parse(str9);
                }
                if (!str10.Equals(string.Empty))
                {
                    this._2ContentScrollY = int.Parse(str10);
                }
                if (!str11.Equals(string.Empty))
                {
                    this._2FooterScrollX = int.Parse(str11);
                }
                if (!str12.Equals(string.Empty))
                {
                    this._2FooterScrollY = int.Parse(str12);
                }
            }
            return false;
        }

        protected override void OnInit(EventArgs e)
        {
            try
            {
                this.Controls.Add(this.LeftPanel);
            }
            catch (Exception)
            {
            }
            try
            {
                this.Controls.Add(this.RightPanel);
            }
            catch (Exception)
            {
            }
            base.OnInit(e);
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            string webResourceUrl = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Splitter2.Resources.oboutSplitter2.min.js");
            this.ScriptResourceRendered = this.RegisterScriptResource(webResourceUrl);
        }

        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            if (this.RememberScrollPosition)
            {
                this.Page.ClientScript.RegisterHiddenField("h_" + this.ClientID + "_1HeaderX", this._1HeaderScrollX.ToString());
                this.Page.ClientScript.RegisterHiddenField("h_" + this.ClientID + "_1HeaderY", this._1HeaderScrollY.ToString());
                this.Page.ClientScript.RegisterHiddenField("h_" + this.ClientID + "_1ContentX", this._1ContentScrollX.ToString());
                this.Page.ClientScript.RegisterHiddenField("h_" + this.ClientID + "_1ContentY", this._1ContentScrollY.ToString());
                this.Page.ClientScript.RegisterHiddenField("h_" + this.ClientID + "_1FooterX", this._1FooterScrollX.ToString());
                this.Page.ClientScript.RegisterHiddenField("h_" + this.ClientID + "_1FooterY", this._1FooterScrollY.ToString());
                this.Page.ClientScript.RegisterHiddenField("h_" + this.ClientID + "_2HeaderX", this._2HeaderScrollX.ToString());
                this.Page.ClientScript.RegisterHiddenField("h_" + this.ClientID + "_2HeaderY", this._2HeaderScrollY.ToString());
                this.Page.ClientScript.RegisterHiddenField("h_" + this.ClientID + "_2ContentX", this._2ContentScrollX.ToString());
                this.Page.ClientScript.RegisterHiddenField("h_" + this.ClientID + "_2ContentY", this._2ContentScrollY.ToString());
                this.Page.ClientScript.RegisterHiddenField("h_" + this.ClientID + "_2FooterX", this._2FooterScrollX.ToString());
                this.Page.ClientScript.RegisterHiddenField("h_" + this.ClientID + "_2FooterY", this._2FooterScrollY.ToString());
            }
            this.Page.RegisterRequiresPostBack(this);
        }

        public void RaisePostDataChangedEvent()
        {
        }

        private string RandomString(int size)
        {
            StringBuilder builder = new StringBuilder();
            Random random = new Random();
            for (int i = 0; i < size; i++)
            {
                char ch = Convert.ToChar(Convert.ToInt32((double) ((26.0 * random.NextDouble()) + 65.0)));
                builder.Append(ch);
            }
            return builder.ToString().ToLower();
        }

        public bool RegisterScriptResource(string url)
        {
            if (this.Page.Form == null)
            {
                return false;
            }
            HtmlHead header = this.Page.Header;
            ScriptManagerHelper helper = new ScriptManagerHelper(this);
            if (header == null)
            {
                try
                {
                    helper.RegisterClientScriptInclude(this, "RegisterScriptReference", url);
                    return true;
                }
                catch
                {
                    return false;
                }
            }
            bool flag = true;
            foreach (Control control in header.Controls)
            {
                HtmlGenericControl control2 = control as HtmlGenericControl;
                if ((control2 != null) && url.Equals(control2.Attributes["src"], StringComparison.OrdinalIgnoreCase))
                {
                    flag = false;
                    break;
                }
            }
            if (flag)
            {
                try
                {
                    HtmlGenericControl child = new HtmlGenericControl("script");
                    child.Attributes.Add("type", "text/javascript");
                    child.Attributes.Add("src", url);
                    child.Attributes.Add("id", "joppa1");
                    header.Controls.Add(child);
                }
                catch
                {
                    try
                    {
                        helper.RegisterClientScriptInclude(this, "RegisterScriptReference", url);
                        return true;
                    }
                    catch
                    {
                        return false;
                    }
                }
            }
            return true;
        }

        protected override void Render(HtmlTextWriter writer)
        {
            string str = (this.CSSPanel == string.Empty) ? "" : ("class=\"" + this.CSSPanel + "\"");
            string str2 = (this.CSSLeftPanel == string.Empty) ? "" : ("class=\"" + this.CSSLeftPanel + "\"");
            string str3 = (this.CSSLeftPanelHeader == string.Empty) ? "" : ("class=\"" + this.CSSLeftPanelHeader + "\"");
            string str4 = (this.CSSLeftPanelContent == string.Empty) ? "" : ("class=\"" + this.CSSLeftPanelContent + "\"");
            string str5 = (this.CSSLeftPanelFooter == string.Empty) ? "" : ("class=\"" + this.CSSLeftPanelFooter + "\"");
            string str6 = (this.CSSRightPanel == string.Empty) ? "" : ("class=\"" + this.CSSRightPanel + "\"");
            string str7 = (this.CSSRightPanelHeader == string.Empty) ? "" : ("class=\"" + this.CSSRightPanelHeader + "\"");
            string str8 = (this.CSSRightPanelContent == string.Empty) ? "" : ("class=\"" + this.CSSRightPanelContent + "\"");
            string str9 = (this.CSSRightPanelFooter == string.Empty) ? "" : ("class=\"" + this.CSSRightPanelFooter + "\"");
            string str10 = (this.CSSDivider == string.Empty) ? "" : ("class=\"" + this.CSSDivider + "\"");
            string str11 = (this.CSSResizeBar == string.Empty) ? "" : ("class=\"" + this.CSSResizeBar + "\"");
            string str12 = (this.CSSCollapseLeft == string.Empty) ? "" : ("class=\"" + this.CSSCollapseLeft + "\"");
            string str13 = (this.CSSCollapseRight == string.Empty) ? "" : ("class=\"" + this.CSSCollapseRight + "\"");
            string str14 = (this.LeftPanel.HeaderUrl == string.Empty) ? "null" : ("\"" + this.LeftPanel.HeaderUrl + "\"");
            string str15 = (this.LeftPanel.ContentUrl == string.Empty) ? "null" : ("\"" + this.LeftPanel.ContentUrl + "\"");
            string str16 = (this.LeftPanel.FooterUrl == string.Empty) ? "null" : ("\"" + this.LeftPanel.FooterUrl + "\"");
            string str17 = "[" + str14 + "," + str15 + "," + str16 + "]";
            string str18 = (this.RightPanel.HeaderUrl == string.Empty) ? "null" : ("\"" + this.RightPanel.HeaderUrl + "\"");
            string str19 = (this.RightPanel.ContentUrl == string.Empty) ? "null" : ("\"" + this.RightPanel.ContentUrl + "\"");
            string str20 = (this.RightPanel.FooterUrl == string.Empty) ? "null" : ("\"" + this.RightPanel.FooterUrl + "\"");
            string str21 = "[" + str18 + "," + str19 + "," + str20 + "]";
            string str22 = "[";
            if (this.LeftPanel.IsWidthDefaultSet || !this.RightPanel.IsWidthDefaultSet)
            {
                str22 = str22 + "'left', " + this.LeftPanel.WidthDefault.ToString() + ", ";
            }
            else if (this.RightPanel.IsWidthDefaultSet)
            {
                str22 = str22 + "'right', " + this.RightPanel.WidthDefault.ToString() + ", ";
            }
            string str31 = str22;
            str22 = (str31 + this.LeftPanel.WidthMin.ToString() + ", " + this.LeftPanel.WidthMax.ToString() + ", " + this.RightPanel.WidthMin.ToString() + ", " + this.RightPanel.WidthMax.ToString()) + "]";
            string str23 = (this.Width < 0) ? "null" : this.Width.ToString();
            if (this.StyleFolder != string.Empty)
            {
                str = "class=\"ob_spl_panel\"";
                str2 = "class=\"ob_spl_leftpanel\"";
                str3 = "class=\"ob_spl_leftpanelheader\"";
                str4 = "class=\"ob_spl_leftpanelcontent\"";
                str5 = "class=\"ob_spl_leftpanelfooter\"";
                str6 = "class=\"ob_spl_rightpanel\"";
                str7 = "class=\"ob_spl_rightpanelheader\"";
                str8 = "class=\"ob_spl_rightpanelcontent\"";
                str9 = "class=\"ob_spl_rightpanelfooter\"";
                str10 = "class=\"ob_spl_dividervertical\"";
                str11 = "class=\"ob_spl_resizebarvertical\"";
                str12 = "class=\"ob_spl_collapseleft\"";
                str13 = "class=\"ob_spl_collapseright\"";
                string relativeUrl = Path.Combine(this.StyleFolder, "style.css").Replace(@"\", "/");
                relativeUrl = base.ResolveUrl(relativeUrl);
                this.CSSPath = relativeUrl;
            }
            CSSDetails details = new CSSDetails {
                CSSPanelHeader = str3,
                CSSPanelContent = str4,
                CSSPanelFooter = str5
            };
            this.LeftPanel.CSSDetails = details;
            CSSDetails details2 = new CSSDetails {
                CSSPanelHeader = str7,
                CSSPanelContent = str8,
                CSSPanelFooter = str9
            };
            this.RightPanel.CSSDetails = details2;
            string str25 = "[ [ [" + this._1HeaderScrollX.ToString() + ", " + this._1HeaderScrollY.ToString() + "],[" + this._1ContentScrollX.ToString() + ", " + this._1ContentScrollY.ToString() + "],[" + this._1FooterScrollX.ToString() + ", " + this._1FooterScrollY.ToString() + "]],[[" + this._2HeaderScrollX.ToString() + ", " + this._2HeaderScrollY.ToString() + "],[" + this._2ContentScrollX.ToString() + ", " + this._2ContentScrollY.ToString() + "],[" + this._2FooterScrollX.ToString() + ", " + this._2FooterScrollY.ToString() + "] ] ] ";
            string str26 = " [ ['" + this.CollapseLeftTooltip + "', '" + this.CollapseRightTooltip + "'],['" + this.ExpandLeftTooltip + "', '" + this.ExpandRightTooltip + "'] ] ";
            if (this.CSSPath == string.Empty)
            {
                str = "class=\"ob_spl_panel\"";
                str2 = "class=\"ob_spl_leftpanel\"";
                str3 = "class=\"ob_spl_leftpanelheader\"";
                str4 = "class=\"ob_spl_leftpanelcontent\"";
                str5 = "class=\"ob_spl_leftpanelfooter\"";
                str6 = "class=\"ob_spl_rightpanel\"";
                str7 = "class=\"ob_spl_rightpanelheader\"";
                str8 = "class=\"ob_spl_rightpanelcontent\"";
                str9 = "class=\"ob_spl_rightpanelfooter\"";
                str10 = "class=\"ob_spl_dividervertical\"";
                str11 = "class=\"ob_spl_resizebarvertical\"";
                str12 = "class=\"ob_spl_collapseleft\"";
                str13 = "class=\"ob_spl_collapseright\"";
                writer.Write("<style type=\"text/css\">");
                Style.arrow_left = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Splitter2.Resources.arrow_left.gif");
                Style.arrow_right = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Splitter2.Resources.arrow_right.gif");
                Style.arrow_top = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Splitter2.Resources.arrow_top.gif");
                Style.arrow_bottom = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Splitter2.Resources.arrow_bottom.gif");
                Style.dividerHorizontal = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Splitter2.Resources.dividerHorizontal.gif");
                Style.dividerVertical = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Splitter2.Resources.dividerVertical.gif");
                writer.Write(Style.GetStyle);
                writer.Write("</style>");
            }
            else
            {
                writer.Write("<link rel=\"stylesheet\" href=\"" + this.CSSPath + "\" media=\"screen\" />");
            }
            if (!this.ScriptResourceRendered)
            {
                writer.Write("<script type=\"text/javascript\" src=\"" + this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Splitter2.Resources.oboutSplitter2.min.js") + "\" id=\"joppa3\"></script>");
                this.ScriptResourceRendered = true;
            }
            string str28 = "{'OnSplitterResize':'" + this.OnSplitterResize + "', 'OnSplitterInitEnd':'" + this.OnSplitterInitEnd + "', 'OnSplitterCollapseExpand':'" + this.OnSplitterCollapseExpand + "'}";
            ScriptManagerHelper helper = new ScriptManagerHelper(this);
            if (helper.IsAjax)
            {
                StringBuilder builder = new StringBuilder();
                builder.Append("var " + this.ClientID + " = new obout_Splitter2(\"" + this.ClientID + "\"");
                builder.Append(",");
                builder.Append(str22);
                builder.Append(",");
                builder.Append(this.CookieDays.ToString());
                builder.Append(",");
                builder.Append(this.FooterHeight.ToString());
                builder.Append(",");
                builder.Append(str17);
                builder.Append(",");
                builder.Append(str21);
                builder.Append(",");
                builder.Append(str23);
                builder.Append(",");
                builder.Append(str25);
                builder.Append(",");
                builder.Append(str26);
                builder.Append(",");
                builder.Append("\"vertical\"");
                builder.Append(",");
                builder.Append(this.RememberScrollPosition ? "true" : "false");
                builder.Append(",");
                builder.Append(this.SynchronizeScroll ? "true" : "false");
                builder.Append(",");
                builder.Append("\"" + this.PanelResizable + "\"");
                builder.Append(",");
                builder.Append(this.LiveResize ? "true" : "false");
                builder.Append(",");
                builder.Append(this.IsResizable ? "true" : "false");
                builder.Append(", ");
                builder.Append(str28);
                builder.Append(",");
                builder.Append("true");
                builder.Append(",");
                builder.Append(helper.IsInAsyncCallback ? "true" : "false");
                builder.Append(",");
                builder.Append((Constants.SecondExpirationDate && Constants.isTrial) ? "true" : "false");
                builder.Append(");");
                new ScriptManagerHelper(this).RegisterStartupScript(this, "startScript" + this.ID, builder.ToString(), true);
            }
            else
            {
                writer.Write("<script type=\"text/javascript\">");
                writer.Write("var " + this.ClientID + " = new obout_Splitter2(\"" + this.ClientID + "\"");
                writer.Write(",");
                writer.Write(str22);
                writer.Write(",");
                writer.Write(this.CookieDays.ToString());
                writer.Write(",");
                writer.Write(this.FooterHeight.ToString());
                writer.Write(",");
                writer.Write(str17);
                writer.Write(",");
                writer.Write(str21);
                writer.Write(",");
                writer.Write(str23);
                writer.Write(",");
                writer.Write(str25);
                writer.Write(",");
                writer.Write(str26);
                writer.Write(",");
                writer.Write("\"vertical\"");
                writer.Write(",");
                writer.Write(this.RememberScrollPosition ? "true" : "false");
                writer.Write(",");
                writer.Write(this.SynchronizeScroll ? "true" : "false");
                writer.Write(",");
                writer.Write("\"" + this.PanelResizable + "\"");
                writer.Write(",");
                writer.Write(this.LiveResize ? "true" : "false");
                writer.Write(",");
                writer.Write(this.IsResizable ? "true" : "false");
                writer.Write(", ");
                writer.Write(str28);
                writer.Write(",");
                writer.Write("false");
                writer.Write(",");
                writer.Write((helper.IsInAsyncCallback || helper.IsOboutAJAXCallback) ? "true" : "false");
                writer.Write(",");
                writer.Write((Constants.SecondExpirationDate && Constants.isTrial) ? "true" : "false");
                writer.Write(");");
                writer.Write("</script>");
            }
            writer.Write("<table id=\"" + this.ClientID + "\" " + str + " border=\"0\" style=\"width:100%;" + ((this.HideBeforeLoad == VerticalHideBeforeLoadType.both) ? "visibility:hidden;" : "") + "\" cellspacing=\"0\" cellpadding=\"0\">");
            writer.Write("<tr>");
            writer.Write("<td id=\"__" + this.ClientID + "L\" align=\"left\" valign=\"top\">");
            writer.Write("<div id=\"__" + this.ClientID + "LD\" " + str2 + " style=\"overflow:hidden;" + ((this.HideBeforeLoad == VerticalHideBeforeLoadType.left) ? "visibility:hidden;" : "") + "\">");
            this.LeftPanel.RenderControl(writer);
            writer.Write("</div>");
            writer.Write("</td>");
            writer.Write("<td id=\"__" + this.ClientID + "Mid\" " + str10 + "style=\"cursor:" + (this.IsResizable ? "e-resize" : "auto") + "; font-size:1px;\">");
            string webResourceUrl = this.Page.ClientScript.GetWebResourceUrl(base.GetType(), "OboutInc.Splitter2.Resources.pixel.gif");
            switch (this.CollapsePanel)
            {
                case VerticalCollapsePanelType.left:
                {
                    writer.Write("<img alt=\"" + this.CollapseLeftTooltip + "\" src=\"" + webResourceUrl + "\" id=\"dividerImg_" + this.ClientID + "\" " + str12 + " />");
                    if (!helper.IsAjax)
                    {
                        writer.Write("<script type=\"text/javascript\">" + this.ClientID + ".addEvent(document.getElementById(\"dividerImg_" + this.ClientID + "\"), \"mousedown\", moveEvent = function(){eval(" + this.ClientID + ".MoveSeparator('left'))}, false);</script>");
                        break;
                    }
                    StringBuilder builder2 = new StringBuilder();
                    builder2.Append(this.ClientID + ".addEvent(document.getElementById(\"dividerImg_" + this.ClientID + "\"), \"mousedown\", moveEvent = function(){eval(" + this.ClientID + ".MoveSeparator('left'))}, false);");
                    new ScriptManagerHelper(this).RegisterStartupScript(this, "eventScript1" + this.ID, builder2.ToString(), true);
                    break;
                }
                case VerticalCollapsePanelType.right:
                {
                    writer.Write("<img alt=\"" + this.CollapseRightTooltip + "\" src=\"" + webResourceUrl + "\" id=\"dividerImg_" + this.ClientID + "\" " + str13 + " />");
                    if (!helper.IsAjax)
                    {
                        writer.Write("<script type=\"text/javascript\">" + this.ClientID + ".addEvent(document.getElementById(\"dividerImg_" + this.ClientID + "\"), \"mousedown\", moveEvent = function(){eval(" + this.ClientID + ".MoveSeparator('right'))}, false);</script>");
                        break;
                    }
                    StringBuilder builder3 = new StringBuilder();
                    builder3.Append(this.ClientID + ".addEvent(document.getElementById(\"dividerImg_" + this.ClientID + "\"), \"mousedown\", moveEvent = function(){eval(" + this.ClientID + ".MoveSeparator('right'))}, false)");
                    new ScriptManagerHelper(this).RegisterStartupScript(this, "eventScript2" + this.ID, builder3.ToString(), true);
                    break;
                }
                default:
                    writer.Write("&nbsp;");
                    break;
            }
            writer.Write("</td>");
            writer.Write("<td align=\"left\" valign=\"top\" id=\"__" + this.ClientID + "R\">");
            writer.Write("<div id=\"__" + this.ClientID + "RD\" " + str6 + " style=\"overflow:hidden;" + ((this.HideBeforeLoad == VerticalHideBeforeLoadType.right) ? "visibility:hidden;" : "") + "\">");
            this.RightPanel.RenderControl(writer);
            writer.Write("</div>");
            writer.Write("</td>");
            writer.Write("</tr>");
            writer.Write("</table>");
            writer.Write("<span id=\"__" + this.ClientID + "M\" " + str11 + "style=\"position:absolute; display:none; cursor:" + (this.IsResizable ? "e-resize" : "auto") + "; z-index:9999;\"></span>");
            if (Constants.FirstExpirationDate && Constants.isTrial)
            {
                string str30 = this.RandomString(8);
                writer.Write("<div id=\"" + str30 + "\" style=\"position:absolute; top:0px; left:0px; padding-top:5px; padding-bottom:5px; border: 2px solid #cccccc; width:150px; height: 60 px; font: 8pt verdana; background-color: #eeeeee; text-align:center;\">");
                writer.Write("<a href=\"http://www.obout.com/\">obout Splitter</a><br />");
                writer.Write("Evaluation has expired<br />");
                writer.Write("<a href=\"http://www.obout.com/inc/purchase.aspx\">License...</a>");
                writer.Write("</div>");
                if (helper.IsAjax)
                {
                    StringBuilder builder4 = new StringBuilder();
                    builder4.Append("<script language=\"javascript\">");
                    builder4.Append("document.getElementById(\"" + str30 + "\").style.left=" + this.ClientID + ".getLeft(document.getElementById(\"" + this.ClientID + "\"))+\"px\";");
                    builder4.Append("document.getElementById(\"" + str30 + "\").style.top=" + this.ClientID + ".getTop(document.getElementById(\"" + this.ClientID + "\"))+\"px\";");
                    builder4.Append("</script>");
                    new ScriptManagerHelper(this).RegisterStartupScript(this, "expiredScript" + this.ID, builder4.ToString(), false);
                }
                else
                {
                    writer.Write("<script language=\"javascript\">");
                    writer.Write("document.getElementById(\"" + str30 + "\").style.left=" + this.ClientID + ".getLeft(document.getElementById(\"" + this.ClientID + "\"))+\"px\";");
                    writer.Write("document.getElementById(\"" + str30 + "\").style.top=" + this.ClientID + ".getTop(document.getElementById(\"" + this.ClientID + "\"))+\"px\";");
                    writer.Write("</script>");
                }
            }
        }

        public override string ClientID
        {
            get
            {
                if (this._ClientID == string.Empty)
                {
                    if (base.ID == null)
                    {
                        this._ClientID = "spl" + base.ClientID;
                    }
                    else
                    {
                        this._ClientID = base.ID;
                    }
                }
                return this._ClientID;
            }
        }

        [Bindable(true), Category("Splitter appearance"), DefaultValue("Collapse the left panel"), Description("The collapsing left image tooltip")]
        public string CollapseLeftTooltip
        {
            get
            {
                string str = (string) this.ViewState["CollapseLeftTooltip"];
                if (str != null)
                {
                    return str;
                }
                return "Collapse the left panel";
            }
            set
            {
                this.ViewState["CollapseLeftTooltip"] = value;
            }
        }

        [DefaultValue("VerticalCollapsePanelType.none"), Category("Splitter settings"), Bindable(true), Description("Specify wich panel to collapse.  Accepted values are none, left, right.")]
        public VerticalCollapsePanelType CollapsePanel
        {
            get
            {
                if (this.ViewState["CollapsePanel"] == null)
                {
                    return VerticalCollapsePanelType.none;
                }
                return (VerticalCollapsePanelType) this.ViewState["CollapsePanel"];
            }
            set
            {
                this.ViewState["CollapsePanel"] = value;
            }
        }

        [Bindable(true), Category("Splitter appearance"), DefaultValue("Collapse the right panel"), Description("The collapsing right image tooltip")]
        public string CollapseRightTooltip
        {
            get
            {
                string str = (string) this.ViewState["CollapseRightTooltip"];
                if (str != null)
                {
                    return str;
                }
                return "Collapse the right panel";
            }
            set
            {
                this.ViewState["CollapseRightTooltip"] = value;
            }
        }

        [Description("Number of days to keep splitter position in cookie."), Bindable(true), Category("Splitter settings"), DefaultValue(2)]
        public int CookieDays
        {
            get
            {
                object obj2 = this.ViewState["CookieDays"];
                if (obj2 != null)
                {
                    return (int) obj2;
                }
                return 30;
            }
            set
            {
                this.ViewState["CookieDays"] = value;
            }
        }

        [Category("Splitter appearance"), Description("CSS class name for left collapse image."), DefaultValue(""), Bindable(true)]
        public string CSSCollapseLeft
        {
            get
            {
                string str = (string) this.ViewState["CSSCollapseLeft"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSCollapseLeft"] = value;
            }
        }

        [Bindable(true), DefaultValue(""), Description("CSS class name for right collapse image."), Category("Splitter appearance")]
        public string CSSCollapseRight
        {
            get
            {
                string str = (string) this.ViewState["CSSCollapseRight"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSCollapseRight"] = value;
            }
        }

        [Description("CSS class name for divider."), Bindable(true), Category("Splitter appearance"), DefaultValue("")]
        public string CSSDivider
        {
            get
            {
                string str = (string) this.ViewState["CSSDivider"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSDivider"] = value;
            }
        }

        [Bindable(true), Description("CSS class name for left panel."), Category("Splitter appearance"), DefaultValue("")]
        public string CSSLeftPanel
        {
            get
            {
                string str = (string) this.ViewState["CSSLeftPanel"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSLeftPanel"] = value;
            }
        }

        [DefaultValue(""), Category("Splitter appearance"), Description("CSS class name for left panel content."), Bindable(true)]
        public string CSSLeftPanelContent
        {
            get
            {
                string str = (string) this.ViewState["CSSLeftPanelContent"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSLeftPanelContent"] = value;
            }
        }

        [Category("Splitter appearance"), DefaultValue(""), Description("CSS class name for left panel footer."), Bindable(true)]
        public string CSSLeftPanelFooter
        {
            get
            {
                string str = (string) this.ViewState["CSSLeftPanelFooter"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSLeftPanelFooter"] = value;
            }
        }

        [DefaultValue(""), Bindable(true), Description("CSS class name for left panel header."), Category("Splitter appearance")]
        public string CSSLeftPanelHeader
        {
            get
            {
                string str = (string) this.ViewState["CSSLeftPanelHeader"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSLeftPanelHeader"] = value;
            }
        }

        [Category("Splitter appearance"), Bindable(true), Description("CSS class name for panel."), DefaultValue("")]
        public string CSSPanel
        {
            get
            {
                string str = (string) this.ViewState["CSSPanel"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSPanel"] = value;
            }
        }

        [DefaultValue(""), Description("Full path to CSS file."), Bindable(true), Category("Splitter appearance")]
        public string CSSPath
        {
            get
            {
                string str = (string) this.ViewState["CSSPath"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSPath"] = value;
            }
        }

        [Category("Splitter appearance"), Description("CSS class name for resize bar."), Bindable(true), DefaultValue("")]
        public string CSSResizeBar
        {
            get
            {
                string str = (string) this.ViewState["CSSResizeBar"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSResizeBar"] = value;
            }
        }

        [Bindable(true), Category("Splitter appearance"), DefaultValue(""), Description("CSS class name for right panel.")]
        public string CSSRightPanel
        {
            get
            {
                string str = (string) this.ViewState["CSSRightPanel"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSRightPanel"] = value;
            }
        }

        [Bindable(true), Category("Splitter appearance"), DefaultValue(""), Description("CSS class name for right panel content.")]
        public string CSSRightPanelContent
        {
            get
            {
                string str = (string) this.ViewState["CSSRightPanelContent"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSRightPanelContent"] = value;
            }
        }

        [DefaultValue(""), Description("CSS class name for right panel footer."), Category("Splitter appearance"), Bindable(true)]
        public string CSSRightPanelFooter
        {
            get
            {
                string str = (string) this.ViewState["CSSRightPanelFooter"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSRightPanelFooter"] = value;
            }
        }

        [DefaultValue(""), Category("Splitter appearance"), Bindable(true), Description("CSS class name for right panel header.")]
        public string CSSRightPanelHeader
        {
            get
            {
                string str = (string) this.ViewState["CSSRightPanelHeader"];
                if (str != null)
                {
                    return str;
                }
                return string.Empty;
            }
            set
            {
                this.ViewState["CSSRightPanelHeader"] = value;
            }
        }

        [DefaultValue("Expand the left panel"), Category("Splitter appearance"), Bindable(true), Description("The expanding left image tooltip")]
        public string ExpandLeftTooltip
        {
            get
            {
                string str = (string) this.ViewState["ExpandLeftTooltip"];
                if (str != null)
                {
                    return str;
                }
                return "Expand the left panel";
            }
            set
            {
                this.ViewState["ExpandLeftTooltip"] = value;
            }
        }

        [Bindable(true), Category("Splitter appearance"), DefaultValue("Expand the right panel"), Description("The expanding right image tooltip")]
        public string ExpandRightTooltip
        {
            get
            {
                string str = (string) this.ViewState["ExpandRightTooltip"];
                if (str != null)
                {
                    return str;
                }
                return "Expand the right panel";
            }
            set
            {
                this.ViewState["ExpandRightTooltip"] = value;
            }
        }

        [Description("Height of the footer below splitter."), Bindable(true), Category("Splitter settings"), DefaultValue(0)]
        public int FooterHeight
        {
            get
            {
                object obj2 = this.ViewState["FooterHeight"];
                if ((obj2 != null) && (((int) obj2) >= 0))
                {
                    return (int) obj2;
                }
                return 0;
            }
            set
            {
                this.ViewState["FooterHeight"] = value;
            }
        }

        [Category("Splitter settings"), Bindable(true), Description("Specify which panels to hide before splitter is initialized.  Accepted values are none, both, left, right."), DefaultValue("VerticalHideBeforeLoadType.both")]
        public VerticalHideBeforeLoadType HideBeforeLoad
        {
            get
            {
                if (this.ViewState["HideBeforeLoad"] == null)
                {
                    return VerticalHideBeforeLoadType.both;
                }
                return (VerticalHideBeforeLoadType) this.ViewState["HideBeforeLoad"];
            }
            set
            {
                this.ViewState["HideBeforeLoad"] = value;
            }
        }

        [DefaultValue(true), Description("When true, the splitter is resizable."), Category("Splitter settings"), Bindable(true)]
        public bool IsResizable
        {
            get
            {
                object obj2 = this.ViewState["IsResizable"];
                if (obj2 != null)
                {
                    return (bool) obj2;
                }
                return true;
            }
            set
            {
                this.ViewState["IsResizable"] = value;
            }
        }

        [PersistenceMode(PersistenceMode.InnerProperty), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public SplitterPanel LeftPanel
        {
            get
            {
                if (this.ViewState["LeftPanel"] == null)
                {
                    this.ViewState["LeftPanel"] = new SplitterPanel(enumSplitterPanelType.LeftP);
                }
                return (SplitterPanel) this.ViewState["LeftPanel"];
            }
        }

        [Description("When true, the panels will be able to resize on splitter separator moving."), Bindable(true), Category("Splitter settings"), DefaultValue(false)]
        public bool LiveResize
        {
            get
            {
                object obj2 = this.ViewState["LiveResize"];
                return ((obj2 != null) && ((bool) obj2));
            }
            set
            {
                this.ViewState["LiveResize"] = value;
            }
        }

        [Category("Splitter settings"), DefaultValue("ob_spl_OnSplitterCollapseExpand"), Description("The name of the client event for the splitter collapse/expand event."), Bindable(true)]
        public string OnSplitterCollapseExpand
        {
            get
            {
                string str = (string) this.ViewState["OnSplitterCollapseExpand"];
                if (str != null)
                {
                    return str;
                }
                return "ob_spl_OnSplitterCollapseExpand";
            }
            set
            {
                this.ViewState["OnSplitterCollapseExpand"] = value;
            }
        }

        [DefaultValue("ob_spl_OnSplitterInitEnd"), Category("Splitter settings"), Description("The name of the client event for the splitter init end."), Bindable(true)]
        public string OnSplitterInitEnd
        {
            get
            {
                string str = (string) this.ViewState["OnSplitterInitEnd"];
                if (str != null)
                {
                    return str;
                }
                return "ob_spl_OnSplitterInitEnd";
            }
            set
            {
                this.ViewState["OnSplitterInitEnd"] = value;
            }
        }

        [DefaultValue("ob_spl_OnSplitterResize"), Bindable(true), Description("The name of the client event for the splitter resize."), Category("Splitter settings")]
        public string OnSplitterResize
        {
            get
            {
                string str = (string) this.ViewState["OnSplitterResize"];
                if (str != null)
                {
                    return str;
                }
                return "ob_spl_OnSplitterResize";
            }
            set
            {
                this.ViewState["OnSplitterResize"] = value;
            }
        }

        [Category("Splitter settings"), Bindable(true), DefaultValue("VerticalPanelResizableType.right"), Description("Specify which panel should be resized when the window is resizing.  Accepted values are left, right.")]
        public VerticalPanelResizableType PanelResizable
        {
            get
            {
                if (this.ViewState["PanelResizable"] == null)
                {
                    return VerticalPanelResizableType.right;
                }
                return (VerticalPanelResizableType) this.ViewState["PanelResizable"];
            }
            set
            {
                this.ViewState["PanelResizable"] = value;
            }
        }

        [Bindable(true), Description("When true, the splitter panels are keeping their scroll position after postback."), Category("Splitter settings"), DefaultValue(false)]
        public bool RememberScrollPosition
        {
            get
            {
                object obj2 = this.ViewState["RememberScrollPosition"];
                return ((obj2 != null) && ((bool) obj2));
            }
            set
            {
                this.ViewState["RememberScrollPosition"] = value;
            }
        }

        [PersistenceMode(PersistenceMode.InnerProperty), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public SplitterPanel RightPanel
        {
            get
            {
                if (this.ViewState["RightPanel"] == null)
                {
                    this.ViewState["RightPanel"] = new SplitterPanel(enumSplitterPanelType.RightP);
                }
                return (SplitterPanel) this.ViewState["RightPanel"];
            }
        }

        [Bindable(true), DefaultValue(""), Category("Splitter appearance"), Description("Path to folder with splitter style.")]
        public string StyleFolder
        {
            get
            {
                string str = (string) this.ViewState["StyleFolder"];
                if (str != null)
                {
                    return str;
                }
                return "";
            }
            set
            {
                this.ViewState["StyleFolder"] = value;
            }
        }

        [Category("Splitter settings"), Bindable(true), DefaultValue(false), Description("When true, the left content scroll is synchronized with the right content scroll.")]
        public bool SynchronizeScroll
        {
            get
            {
                object obj2 = this.ViewState["SynchronizeScroll"];
                return ((obj2 != null) && ((bool) obj2));
            }
            set
            {
                this.ViewState["SynchronizeScroll"] = value;
            }
        }

        public override string UniqueID
        {
            get
            {
                return base.UniqueID;
            }
        }

        [Description("Width of the whole splitter."), Category("Splitter settings"), Bindable(true), DefaultValue(-1)]
        public int Width
        {
            get
            {
                object obj2 = this.ViewState["Width"];
                if (obj2 != null)
                {
                    return (int) obj2;
                }
                return -1;
            }
            set
            {
                this.ViewState["Width"] = value;
            }
        }
    }
}

